1. Technical Field
The present invention relates in general to display of bidirectional text within a data processing system user interface and in particular to proper display of bidirectional text utilizing normal, left-to-right only directional display controls. Still more particularly, the present invention relates to employing a multi-field text string class to enable proper display of bidirectional text on both bidirectional and non-bidirectional systems.
2. Description of the Related Art
Multinational companies often run information system (IS) networks which span multiple countries spread around the globe. To maximize the usefulness of such networks, operations within each country tend to run in the local language of the country. Where possible, names of abstract objects in user applications are in the local language and match the local language organization, city, or human names which the abstract objects represent. In the case of system management software, often abstract objects would represent each of a global enterprise""s local offices.
Transferring data from one system to another within such a multinational network presents numerous challenges. One obstacle which must be overcome is the transfer of human language directionality. Unlike English and many other languages, certain human languages are customarily written from right-to-left rather than from left-to-right, or may be written in either direction. Hebrew, for example, is conventionally written right-to-left.
For transnational data exchange, language directionality may be addressed in the manner in which the text is encoded. The Unicode specification, for example, assigns a directionality to characters and defines a complex algorithm for determining the proper directionality of text. If a right-to-left text string is encountered, a user agent conforming to the Unicode specification is required to apply the Unicode bidirectional algorithm to display the characters within that string. Similarly, the HyperText Markup Language (HTML) offers higher-level markup constructs which do the same thing, such as the xe2x80x9cdirxe2x80x9d attribute (which is distinct from the DIR element) and the xe2x80x9cBDOxe2x80x9d element.
Support for bidirectional (xe2x80x9cbidixe2x80x9d) text, or support for displaying text in either direction (right-to-left or left-to-right) depending on the cultural convention associated with the human language in which the text is written, is typically integrated into the operating system or application (e.g., browser), if provided at all. Normally bidi text cannot be displayed properly in the user interface of a non-bidi version of an operating system or application without implementation of specialized text display controls.
It would be desirable, therefore, to provide a mechanism allowing normal left-to-right only directional user interface display controls to properly display bidi text in a user interface.
It is therefore one object of the present invention to provide an improved method, system and computer program product for display of bidirectional text within a data processing system user interface.
It is another object of the present invention to provide a method, system and computer program product for proper display of bidirectional text in a data processing system user interface utilizing normal, left-to-right only directional display controls.
It is yet another object of the present invention to provide a method, system and computer program product for employing a multi-field text string class to enable proper display of bidirectional text on both bidirectional and non-bidirectional systems.
The foregoing objects are achieved as is now described. For languages requiring bidirectional (left-to-right and right-to-left) text display support, a multi-field text string object encapsulates both a normal logical ordered version of the text string entered and a reverse ordered version in separate fields. A bidirectional-support property of the multi-field text string object is set based on whether the host system supports bidirectional text displays. In response to a display request, the multi-field text string object checks the bidirectional-support property. If bidirectional text display is supported, the multi-field text string object sets the field containing the normally-ordered character sequence for the text string as the display field. If bidirectional text display is not supported, the multi-field text string object sets the field containing the reverse-ordered character sequence for the text string as the display field. Display controls receiving the normally-ordered character sequence should display the text string with the proper directionality (right-to-left). Display controls receiving the reverse-ordered character sequence will display the display field contents with the incorrect directionality (left-to-right) but, as a result of the character sequence reversal, will effectively display the text string with the proper directionality. Bidirectional text may thus be displayed on systems which do not support bidirectional text display, using only conventional, left-to-right only directional display controls.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.